import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: qian
 * Date: 2023-02-12
 * Time: 10:40
 */
public class test9 {
    public static void main(String[] args) throws IOException {
        //针对写文本文件，还可以使用PrinterWriter来简化开发
        OutputStream outputStream=new FileOutputStream("./bbb.txt");
        PrintWriter printWriter=new PrintWriter(outputStream);
        printWriter.println(12);
        printWriter.printf("%s","hello");
        outputStream.close();
    }
}
